package com.ruoyi.workSafetyStandardization.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.workSafetyStandardization.mapper.BasicStandardMapper;
import com.ruoyi.workSafetyStandardization.domain.BasicStandard;
import com.ruoyi.workSafetyStandardization.service.IBasicStandardService;

/**
 * 达标基本条件Service业务层处理
 *
 * @author hcc
 * @date 2023-12-15
 */
@Service
public class BasicStandardServiceImpl implements IBasicStandardService
{
    @Autowired
    private BasicStandardMapper basicStandardMapper;

    /**
     * 查询达标基本条件
     *
     * @param basicStandardId 达标基本条件主键
     * @return 达标基本条件
     */
    @Override
    public BasicStandard selectBasicStandardByBasicStandardId(String basicStandardId)
    {
        return basicStandardMapper.selectBasicStandardByBasicStandardId(basicStandardId);
    }

    /**
     * 查询达标基本条件列表
     *
     * @param basicStandard 达标基本条件
     * @return 达标基本条件
     */
    @Override
    public List<BasicStandard> selectBasicStandardList(BasicStandard basicStandard)
    {
        return basicStandardMapper.selectBasicStandardList(basicStandard);
    }

    /**
     * 新增达标基本条件
     *
     * @param basicStandard 达标基本条件
     * @return 结果
     */
    @Override
    public int insertBasicStandard(BasicStandard basicStandard)
    {
        basicStandard.setCreateByName(SecurityUtils.getUsername());
        basicStandard.setCreateAt(new Date());
        basicStandard.setCreateBy(SecurityUtils.getUserId().toString());
        return basicStandardMapper.insertBasicStandard(basicStandard);
    }

    /**
     * 修改达标基本条件
     *
     * @param basicStandard 达标基本条件
     * @return 结果
     */
    @Override
    public int updateBasicStandard(BasicStandard basicStandard)
    {
        return basicStandardMapper.updateBasicStandard(basicStandard);
    }

    /**
     * 批量删除达标基本条件
     *
     * @param basicStandardIds 需要删除的达标基本条件主键
     * @return 结果
     */
    @Override
    public int deleteBasicStandardByBasicStandardIds(String[] basicStandardIds)
    {
        return basicStandardMapper.deleteBasicStandardByBasicStandardIds(basicStandardIds);
    }

    /**
     * 删除达标基本条件信息
     *
     * @param basicStandardId 达标基本条件主键
     * @return 结果
     */
    @Override
    public int deleteBasicStandardByBasicStandardId(String basicStandardId)
    {
        return basicStandardMapper.deleteBasicStandardByBasicStandardId(basicStandardId);
    }
}
